package com.tangyuan.common.config;


import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
@Data
public class WxPayConfig {


    /**----------------------------微信证书----------------------------------*/
    public static String appId;
    public static String secret;
    public static String mchId;
    public static String mchKey;
    public static String subAppId;
    public static String subSecret;
    public static String keyPath;
    public static String certPath;
    public static String certP12Path;
    public static String platformCert;

    public static final String WX_REFUND_URL = "https://www.tangyuanshipin.com/api/user/wx/authRedirect";

    @Value("${wx.pay.appId:}")
    public void setAppId(String appId) {
        WxPayConfig.appId = appId;
    }
    @Value("${wx.pay.secret:}")
    public void setSecret(String secret) {
        WxPayConfig.secret = secret;
    }
    @Value("${wx.pay.mchId:}")
    public void setMchId(String mchId) {
        WxPayConfig.mchId = mchId;
    }
    @Value("${wx.pay.mchKey:}")
    public void setMchKey(String mchKey) {
        WxPayConfig.mchKey = mchKey;
    }
    @Value("${wx.pay.subAppId:}")
    public void setSubAppId(String subAppId) {
        WxPayConfig.subAppId = subAppId;
    }
    @Value("${wx.pay.subSecret:}")
    public void setSubSecret(String subSecret) {
        WxPayConfig.subSecret = subSecret;
    }
    @Value("${wx.pay.keyPath:}")
    public void setKeyPath(String keyPath) {
        WxPayConfig.keyPath = keyPath;
    }
    @Value("${wx.pay.certPath:}")
    public void setCertPath(String certPath) {
        WxPayConfig.certPath = certPath;
    }
    @Value("${wx.pay.certP12Path:}")
    public void setCertP12Path(String certP12Path) {
        WxPayConfig.certP12Path = certP12Path;
    }
    @Value("${wx.pay.platformCert:}")
    public void setPlatformCert(String platformCert) {
        WxPayConfig.platformCert = platformCert;
    }

}
